package com.orhon.smartcampus.modules.student.mm;



import java.util.List;

import org.mapstruct.InheritConfiguration;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;
import org.mapstruct.factory.Mappers;

import com.orhon.smartcampus.modules.base.mm.LangMapper;
import com.orhon.smartcampus.modules.student.entity.Traffic;
import com.orhon.smartcampus.modules.student.gqlModel.GQLTraffic;

@Mapper(
        uses = {
                LangMapper.class
        }
)
public interface TrafficsMapper {


    TrafficsMapper MAPPER = Mappers.getMapper(TrafficsMapper.class);


    @Mappings({
            @Mapping(source = "id" , target = "id"),
            @Mapping(source = "userId" , target = "userId"),
            @Mapping(source = "studentId" , target = "studentId"),
            @Mapping(source = "distance" , target = "distance"),
            @Mapping(source = "trafficReleaseId" , target = "trafficReleaseId"),
            @Mapping(source = "isSchoolBus" , target = "isSchoolBus"),
            @Mapping(source = "createdBy" , target = "createdBy"),
            @Mapping(source = "createdAt" , target = "createdAt"),
            @Mapping(source = "updatedAt" , target = "updatedAt"),
            @Mapping(source = "updatedBy" , target = "updatedBy"),
            @Mapping(source = "deletedAt" , target = "deletedAt")
    })
    GQLTraffic toTraffic(Traffic entity);
    
    @InheritConfiguration(name = "toTraffic")
    List<GQLTraffic> toTrafficList(List<Traffic> entities);
}
